Software developers typically invest many hours testing each section or module of software they develop to help ensure that the software will operate as expected without generating errors, faults, or other execution maladies. Such testing may include tests executed at the object, module, and application level within a development environment, such as that provided by way of an integrated development environment facilitating the writing, testing, debugging, and revision of software.
However, despite attempts to deliver error-free software to the user, untested or unanticipated uses of the software may cause problems to occur. To detect sources of errors in such cases, some software provides a tracing mode, in which the execution path of the software is recorded for subsequent perusal by software developers or maintenance personnel. By reviewing the resulting trace, which is often provided in a log file or similar data structure, the developer may determine the cause of the error and revise the software to eliminate it. In some cases, parameters and return values associated with methods or functions may be added to the log file to provide useful information to the developer.
To provide the tracing information, developers typically add instructions to each method or function of interest to store the data to the tracing log file. In addition, these additional instructions may be executed only under the condition that tracing functionality is enabled. In many implementations, a user of the software may enable the tracing functionality by way of an additional input when the user initiates execution of the software.
One alternative to the typical tracing implementation described above is the use of aspect-oriented programming, by which a special compiler may “inject” additional code into the software to provide instructions for the tracing function. Some implementations of such an alternative, however, may be difficult to implement in large professional production software suites that are compiled using standard compilers. Also, allowing a user to enable or disable tracing functionality at runtime and applying such tracing to only specific user sessions may not be possible with some compilers.